import request from "@/request/request";
import requestMock from "@/request/requestMock";
// 获取三级列表
export function getCatList() {
    return request.get("/product/getBaseCategoryList")
}
// 请求轮播图List(Mock请求)
export function getBannerList() {
    return requestMock.get('/banner/list')
}
export function getfloorList() {
    return requestMock.get('/floor/list')
}
// 请求搜索数据
export function getSearchList(searchParams) {
    return request.post("/list", searchParams)
}
// 获取商品详细信息
export function getGoodsku(skuId) {
    return request.get(`/item/${skuId}`)
}
// 添加至购物车
export function addCartSuccess(skuId, skuNum) {
    return request.post(`cart/addToCart/${skuId}/${skuNum}`)
}
// 获取购物车列表
export function addCartlist() {
    return request.get(`cart/cartList`)
}
//单个选中
export function checkOne(skuID, isChecked) {
    return request.get(`/cart/checkCart/${skuID}/${isChecked}`)
}
// 单个删除
export function deleteOne(skuId) {
    return request.delete(`cart/deleteCart/${skuId}`)
}
// 全部选中
export function allChecked(isChecked, skuIdList) {
    return request.post(`/cart/batchCheckCart/${isChecked}`, skuIdList)
}
// 批量删除
export function delCehcked(skuIdList) {
    return request.delete(`/cart/batchDeleteCart`, skuIdList)
}
// 获取验证码
export function getPassport(phone) {
    return request.get(`/user/passport/sendCode/${phone}`)
}
// 注册
export function reqUserRegister(userInfo) {
    return request.post(`/user/passport/register`, userInfo)
}
// 登录
export function reqUserLogin(userInfo) {
    return request.post(`user/passport/login`, userInfo)
}
// 获取用户信息
export function getUserInfo() {
    return request.get(`user/passport/auth/getUserInfo`)
}
//  用户登出
export function reqUserlogout() {
    return request.get(`/user/passport/logout`)
}
// 获取用户地址
export function getaddressList() {
    return requestMock.get('/address/list')
}
// 获取交易页信息
export function tradeInfo() {
    return request.get('/order/auth/trade')
}
// 提交订单
export function submitOrder(tradeNo, tradeInfo) {
    return request.post(`/order/auth/submitOrder?tradeNo=${tradeNo}`, tradeInfo)
}
// 提交订单
export function createNative(orderId,) {
    return request.get(`/payment/weixin/createNative/${orderId}`)
}
// 查询订单支付状态
export function getPayStatus(orderId) {
    return request.get(`/payment/weixin/queryPayStatus/${orderId}`)
}

// 请求订单列表
export function getOrderList(page, limit) {
    return request.get(`/order/auth/${page}/${limit}`)
}

